package com.xianrenit.xianrenpuzi.service.product.client;

import com.xianrenit.xianrenpuzi.model.entity.product.ProductSku;
import com.xianrenit.xianrenpuzi.model.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "service-product")
public interface ProductClient {
    //因为远程调用时data存的是 sku对象
    @GetMapping("/api/product/getById/{skuId}")
    public Result<ProductSku> getById(@PathVariable("skuId")Long skuId);

    @PutMapping("/api/product/updateSalesAndStock/{skuId}/{skuNum}")
    public Result  updateSalesAndStock(@PathVariable("skuId")Long skuId,
                                       @PathVariable("skuNum")Integer skuNum);
}
